package gameEngine.agents.teamMateModel;

import org.apache.log4j.Logger;

/**
 * implementation for AgentMock interface
 * @author alon
 *
 */
public class AgentMockImpl implements AgentMock {
	double Compitance;
	double eGreedy;
	int id;
	Logger log=Logger.getLogger(this.getClass());
	/**
	 * simple constructor
	 * @param compitance
	 * @param eGreedy
	 * @param id
	 */
	public AgentMockImpl(double compitance, double eGreedy,int id) {
		super();
		Compitance = compitance;
		this.eGreedy = eGreedy;
		this.id=id;		
	}
	
	/**
	 * competence getter
	 * @return
	 */
	public double getCompitance() {
		return Compitance;
	}
	
	/**
	 * competence setter
	 * @param compitance
	 */
	public void setCompitance(double compitance) {
		Compitance = compitance;
	}
	
	public double geteGreedy() {
		return eGreedy;
	}
	public void seteGreedy(double eGreedy) {
		this.eGreedy = eGreedy;
	}
	public double getAgentCompitance() {
		return getCompitance();
	}
	public double getAgentEGreedy() {
		return geteGreedy();
	}
	public void setAgentCompitance(double compitance) {
		setCompitance(compitance);
	}
	public void setAgentEGreedy(double eGreedy) {
		seteGreedy(eGreedy);
	}
	public int getId() {
		return id;
	}
	/**
	 * sort AgentMock in descending order by competence  
	 */
	public int compareTo(AgentMock agent) {
		if(getCompitance()-agent.getAgentCompitance()>0){
			return -1;
		}else{
			return 1;
		}
	}
	
	public AgentMock clone(){
		AgentMockImpl copy=new AgentMockImpl(Compitance, eGreedy, id);
		return copy;
	}

}
